package com.sinog.front.feign.biz;

import com.sinog.core.model.UploadAppendixFile;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;

/**
 * @desc 上传文件feign
 * @author -
 * @date -
 */
@FeignClient("sinog2c-biz")
public interface UploadAppendixFileFeignService {

    /**
     * 将文件信息保存到mysql库中
     * @param uploadAppendixFile uploadAppendixFile
     * @return Integer
     */
    @PostMapping("/upload/appendix/save/data")
    Integer saveAppendixFileData(@RequestBody UploadAppendixFile uploadAppendixFile);

    /**
     * 从mysql库中查询出文件信息
     * @param pageIndex pageIndex
     * @param pageSize pageSize
     * @param map map
     * @return List<UploadAppendixFile>
     */
    @RequestMapping("/upload/appendix/list/data")
    List<UploadAppendixFile> selectAppendixFileData(
            @RequestParam("pageIndex") Integer pageIndex,
            @RequestParam("pageSize") Integer pageSize,@RequestBody Map<String,Object> map);

    /**
     * 查询文件数
     * @param map map
     * @return int
     */
    @RequestMapping("/upload/appendix/list/count")
    int count(@RequestBody Map<String,Object> map);

    /**
     * 根据id priNum taskId查询上传文件数量
     * @param map map
     * @return int
     */
    @RequestMapping("/upload/appendix/list/getCountById")
    int getCountById(@RequestBody Map<String,Object> map);

    /**
     * 根据id priNum taskId删除单个上传文件
     * @param map map
     * @return int
     */
    @RequestMapping("/upload/appendix/list/deleteFileById")
    int deleteFileById(@RequestBody Map<String,Object> map);

    /**
     * 修改状态表
     * @param map map
     */
    @RequestMapping("/upload/appendix/list/changeTemp")
    void changeTemp(@RequestBody Map<String,Object> map);

    /**
     * 从mysql库中查找单个文件
     * @param uploadAppendixFile uploadAppendixFile
     * @return UploadAppendixFile
     */
    @PostMapping("/upload/appendix/one/data")
    UploadAppendixFile findAppendixfileOne(@RequestBody UploadAppendixFile uploadAppendixFile);

    /**
     * 从mysql库中删除单个文件信息
     * @param uploadAppendixFile uploadAppendixFile
     */
    @PostMapping("/upload/appendix/delete/data")
    void removeAppendixFileOne(@RequestBody UploadAppendixFile uploadAppendixFile);

    /**
     * 从mysql库中删除单个文件信息仅通过single_id
     * @param uploadAppendixFile uploadAppendixFile
     * @return int
     */
    @PostMapping("/upload/appendix/delete/data/single")
    int removeAppendixFileOneBySingleId(@RequestBody UploadAppendixFile uploadAppendixFile);

    /**
     * 司法所衔接选择失败后将之前上传的公安附件删除
     * @param priNum priNum
     * @param id id
     * @return int
     */
    @PostMapping("/azbj/yazgj/xj/deleteUploadFile")
    int deleteUploadFile(@RequestParam(value = "priNum", required = false) String priNum,@RequestParam(value = "id", required = false) String id);
}